<template>
    <div class="node">
        <h3>{{ data.title }}</h3>
        <ul v-if="data.children">
            <li v-for="item in data.children" :key="item.id">
                <Node :data="item" />
            </li>
        </ul>
    </div>
</template>

<script>
export default {
    // 必须指定这个 name 属性
    name: 'Node',
    props: {
        data: {
            type: Object,
            required: true,
        },
    },
};
</script>
